import { S } from '../s';
import { IPSControlItemParam } from './ipscontrol-item-param';
import { IPSSysImage } from '../res/ipssys-image';
import { IPSUIAction } from '../view/ipsuiaction';
import { PSModelObjectImpl } from '../psmodel-object-impl';

export class PSControlItemParamProxy
  extends PSModelObjectImpl
  implements IPSControlItemParam
{
  get caption(): string {
    return this.M.caption;
  }

  get key(): string {
    return this.M.key;
  }

  protected pssysimage: IPSSysImage;
  getPSSysImage(): IPSSysImage | null {
    return (
      this.pssysimage ||
      (this.pssysimage = this.fillObjectModel(
        S._27b,
        this.M.getPSSysImage,
        S._2ad,
      ) as IPSSysImage)
    );
  }

  protected psuiaction: IPSUIAction;
  getPSUIAction(): IPSUIAction | null {
    return (
      this.psuiaction ||
      (this.psuiaction = this.fillObjectModel(
        S._29d,
        this.M.getPSUIAction,
        S._2de,
      ) as IPSUIAction)
    );
  }

  get tooltip(): string {
    return this.M.tooltip;
  }

  get value(): string {
    return this.M.value;
  }
  get cls(): string {
    return 'PSControlItemParamProxy';
  }
  instanceof(cls: string): boolean {
    if (cls == S._3bf) return true;
    return super.instanceof(cls);
  }
}
